<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('菜房出库列表')"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <input type="hidden" name="params[ancestors]" th:value="${ancestors}"/>
                <input type="hidden" name="params[cforderFor]" th:value="${cfOrderFor}"/>
                <div class="select-list">
                    <ul>

                        <li>
                            出库类型：<select name="outputType" th:with="type=${@dict.getType('cforderType')}">
                            <option value="">所有</option>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
                                    th:value="${dict.dictValue}"></option>
                        </select>
                        </li>
                        <li class="select-time">
                            <label>出库时间： </label>
                            <input type="text" class="time-input" th:value="${beginTime}" id="startTime"
                                   placeholder="开始时间"
                                   name="params[beginTime]"/>
                            <span>-</span>
                            <input type="text" class="time-input" th:value="${endTime}" id="endTime" placeholder="结束时间"
                                   name="params[endTime]"/>
                        </li>


                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">

            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:ncOuputCf:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:ncOuputCf:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:ncOuputCf:remove')}]];
    var prefix = ctx + "system/ncOuputCf";

    var datas = [[${@dict.getType('cforderType')}]];
    $(function () {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "菜房出库",
            showExport: true,
            columns: [{
                checkbox: true
            },
                {
                    field: 'outputId',
                    title: '出库id',
                    visible: false
                },

                {
                    field: 'outputType',
                    title: '出库类型',
                    formatter: function (value, row, index) {
                        return $.table.selectDictLabel(datas, value);
                    }
                },
                {
                    field: 'realAmout',
                    title: '实际提供数量（kg）',
                    sortable: true
                },
                {
                    field: 'boxAmount',
                    title: '框数',
                    sortable: true
                },
                {
                    field: 'outputTime',
                    title: '出库时间',
                    sortable: true
                },
                {
                    field: 'outputUser',
                    title: '出库经手人',
                    sortable: true
                },

                {
                    field: 'remark',
                    title: '备注',
                }
            ]
        };
        $.table.init(options);

    });
</script>
</body>
</html>